import { useContext } from 'react'
import { GlobalContext } from '@/utils/context.ts'
import defaultLocale from '../locale'
type Lang = 'zh-CN' | 'en-US'
export type langType = {
  [key in Lang]: any
}
function useLocale(locale?: langType) {
  const { lang } = useContext(GlobalContext)
  return (locale || defaultLocale)[lang as Lang] || {}
}
export default useLocale
